# Author:lzhan  Date:2020/3/17
# import lxml.html as lx

# lxml 包   html 模块  etree 方法
from lxml.html import etree

xml_books=etree.parse('data/books.xml')

titles=xml_books.xpath('//title')
# titles=xml_books.xpath('./book/title')
authors=xml_books.xpath('//author')

print(len(titles))
print(len(authors))
